<template>
<div class="page">
  <nav-com
    title="提货券转让"
    :showView="true"
    @back="backHandler()"></nav-com>
  <van-field label-class="label" style="margin-top: 5vw" v-model="mobile" placeholder="请输入对方注册账号"  label="对方账号" />
  <div class="btn" @click="transfer">确认转让</div>
</div>
</template>

<script>
import navCom from "@/component/nav";
import {Toast} from "vant";
import {increase} from "../../../api/myExaminatonGaper";
export default {
  name: "index",
  components: {
    navCom,
  },
  data(){
      return {
        mobile:""
      }
  },
  mounted() {
    // console.log(1);
  },
  methods: {
    backHandler() {
      this.$router.go(-1);
    },
  async transfer(){
      // console.log(this.$route.params.id)
      if(!this.mobile.trim()){
        Toast('不可以为空');
      }else{
      const res=  await increase({
          id:this.$route.params.id,
        mobile:this.mobile,
        })
        Toast(res.data.msg);
      if(res.data.code==1){
          this.backHandler();
      }
      }


  }
  },
}
</script>

<style scoped>
.page{
  width: 100vw;
  height: 100vh;
  background: #F5F5F5;
}
.btn{
  width: 93.6vw;
  height: 13.3vw;
  background: #FF8933;
  margin: 0 auto;
  font-size: 4.5vw;
  text-align: center;
  line-height: 13.3vw;
  margin-top: 5.6vw;
  font-family: PingFangSC-Medium, PingFang SC;
  /*font-weight: 500;*/
  color: #FFFFFF;
  border-radius: 1vw;
}
.label{
  font-size: 4.5vw;
  font-family: PingFangSC-Medium, PingFang SC;
  font-weight: 500;
  color: #333333;
}
</style>